<?php

/**
 * Evento form base class.
 *
 * @package    form
 * @subpackage evento
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseEventoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_evento'  => new sfWidgetFormInputHidden(),
      'nm_evento'  => new sfWidgetFormInput(),
      'ds_evento'  => new sfWidgetFormTextarea(),
      'ds_resumo'  => new sfWidgetFormInput(),
      'st_evento'  => new sfWidgetFormInput(),
      'dt_evento'  => new sfWidgetFormDateTime(),
      'user_id'    => new sfWidgetFormDoctrineChoice(array('model' => 'sfGuardUserProfile', 'add_empty' => true)),
      'created_at' => new sfWidgetFormDateTime(),
      'updated_at' => new sfWidgetFormDateTime(),
      'deleted'    => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id_evento'  => new sfValidatorDoctrineChoice(array('model' => 'Evento', 'column' => 'id_evento', 'required' => false)),
      'nm_evento'  => new sfValidatorString(array('max_length' => 200)),
      'ds_evento'  => new sfValidatorString(),
      'ds_resumo'  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'st_evento'  => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'dt_evento'  => new sfValidatorDateTime(array('required' => false)),
      'user_id'    => new sfValidatorDoctrineChoice(array('model' => 'sfGuardUserProfile', 'required' => false)),
      'created_at' => new sfValidatorDateTime(array('required' => false)),
      'updated_at' => new sfValidatorDateTime(array('required' => false)),
      'deleted'    => new sfValidatorBoolean(),
    ));

    $this->widgetSchema->setNameFormat('evento[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Evento';
  }

}
